﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace homework5_7
{
    class Program
    {
        static void Main(string[] args)
        {
            int letters = 0;  //字母数
            int digits = 0;  //数字数
            int punctuations = 0; //标点数
            Console.WriteLine("请入入一个字符串");
            string string1 = Console.ReadLine(); //循环取遍所有字母
            foreach(char ch in string1)
            {
                if (char.IsLetter(ch))//字母位置
                    letters++;
                if (char.IsDigit(ch))//数字位置
                    digits++;
                if (char.IsPunctuation(ch))//标点位置
                    punctuations++;
            }
            Console.WriteLine("字母个数:{0}", letters);
                Console.WriteLine("数字个数：{0}", digits);
            Console.WriteLine("标点个数:{0}", punctuations);
            Console.ReadKey();






        }
    }
}
